package com.gome.axwl.aoc.openApi.api.app;

import com.gome.axwl.aoc.entity.dto.AppVersionDto;
import com.gome.axwl.aoc.facade.AppVersionFacade;
import com.gome.commons.core.ResultData;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 *
 * 项目名称：gome-axwl-aoc-web
 * 类名称：AppVersionController
 * 类描述：
 * 创建人：chengh
 * 创建时间：2018年4月27日16:07:16
 * @version
 */
@Api(tags="APP版本管理")
@RestController
@RequestMapping(value = "/appVersion", method = RequestMethod.POST)
public class AppVersionOpenApiController {

    private final static Logger log = LoggerFactory.getLogger(AppVersionOpenApiController.class);

    @Autowired
    AppVersionFacade appVersionFacade;

    /**
     * 检测用户是否需要升级--app端调用
     * @param accountNo
     * @param dcNo
     * @param versionCode
     * @param versionSystemType
     * @return
     */
    @RequestMapping(value = "/checkUpdate", method = RequestMethod.POST)
    public ResultData<AppVersionDto> checkUpdate(String accountNo, String dcNo, String versionCode, String versionSystemType){
        log.info("AppVersionController.checkUpdate(检测用户是否需要升级),用户账号:{},DC编码:{},版本编号:{},系统类型(0-android 1-ios):{}", accountNo, dcNo, versionCode, versionSystemType);
        return appVersionFacade.checkUpdate(accountNo, dcNo, versionCode, versionSystemType);
    }

}
